public class listDome {
    public static void main(String[] args) {
        //node hand = new node();
        /*hand.add(5);
        hand.add(6);*/
        hand root = new hand();
        root.add(1);
        root.add(2);
        root.add(3);

        System.out.println(root);


    }

}


class hand{
    private node root = new node();
    public void add(int a) {
        node hand = root;
        while (true) {
            if (hand.next == null) {
                break;
            } else {
                hand = hand.next;
            }
        }
        hand.next = new node();
        hand.next.id = a;
    }

    @Override
    public String toString() {
        return root.toString();
    }
}
class node {
    int id;
    node next;

    @Override
    public String toString() {
        return id + ","+next;
    }


}
